package com.gpagers.core;

import java.applet.Applet;
import java.applet.AudioClip;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Date;

import org.eclipse.swt.SWT;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import com.gpagers.ui.Main;
import com.gpagers.ui.TopDg;

/**  
 * 需要执行的任务  
 * @author lhy  
 *  
 */
@DisallowConcurrentExecution
public class MyJob implements Job {
    private TopDg al;

    @Override
    //把要执行的操作，写在execute方法中  
    public void execute(final JobExecutionContext arg0) throws JobExecutionException {
        ObjectRef.display.asyncExec(new Runnable() {
            @Override
            public void run() {
                for (TopDg temp : ObjectRef.dialogList) {
                    if (!temp.isDisposed()) {
                        temp.close();
                    }
                }
                String msg = arg0.getJobDetail().getJobDataMap().get("msg").toString();
                al = new TopDg(ObjectRef.mainShell, SWT.DIALOG_TRIM, msg);
                ObjectRef.dialogList.clear();
                ObjectRef.dialogList.add(al);
                al.open();
            }
        });

    }

}